image: use the default icon size if no icon size is provided
authorCosimo Cecchi <cosimoc@gnome.org>
Thu, 1 Dec 2011 00:46:31 +0000 (19:46 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Thu, 1 Dec 2011 00:47:52 +0000 (19:47 -0500)
If no icon size is provided (e.g. when setting icon-name or stock-id
using the GObject property directly), use the default icon size. This
matches the previous GtkImage behavior.

gtk/gtkimage.c

index 5f392deebbaddee10e2a70e8a2ca5eb2c75b2cc5..2f12541b473e07a0db82239e6ac34c2bce00d384 100644 (file)
@@ -380,6 +380,9 @@ gtk_image_set_property (GObject      *object,
   GtkImagePrivate *priv = image->priv;
   GtkIconSize icon_size = _gtk_icon_helper_get_icon_size (priv->icon_helper);
 
+  if (icon_size == GTK_ICON_SIZE_INVALID)
+    icon_size = DEFAULT_ICON_SIZE;
+
   switch (prop_id)
     {
     case PROP_PIXBUF: